package com.factory;

public abstract class AbstractFactory {


    protected abstract void getFruit();


    public void getFruit(String type) {
        if (type.equalsIgnoreCase("apple")) {
            new AppleFactory().getFruit();
        } else if ("banana".equalsIgnoreCase(type)) {
            new BananaFactory().getFruit();
        } else if (type.equalsIgnoreCase("orange")) {
            new OrangeFactory().getFruit();
        }
    }


}
